package com.example.jetpackcomposelearning.util;


import android.net.Uri;


import com.hv.mediapackffmpegkitsdk.MediaPack;
import com.hv.mediapackffmpegkitsdk.MediaPackOption;

import java.util.List;

public class MediaService {


    public static boolean combineFromMaterials(List<Uri> inputs, String blurPath, String stickerPath, Uri outputVideo) {
        MediaPackOption options = MediaPackOption.For_iMX8();
        options.set(MediaPackOption.ZoomPanStep, 0.001);
        options.set(MediaPackOption.PaddingColor, "black");
        options.set(MediaPackOption.OutputBitRate, 6000 * 1000);
        options.set(MediaPackOption.Fonttext, "HASCO VISION");
        options.set(MediaPackOption.FontColor, "#29B6F6");
        options.set(MediaPackOption.FontSize, 40);
        options.set(MediaPackOption.FontLeft, "20");
        options.set(MediaPackOption.FontTop, "20");
        options.set(MediaPackOption.FontType, "/system/fonts/MiSansVF.ttf");
        options.set(MediaPackOption.FontBorderw, 3)
                .set(MediaPackOption.FontBorderColor, "#EF97A2")
                .set(MediaPackOption.FontBox, 0)
                .set(MediaPackOption.FontBoxBorderw, "10")
                .set(MediaPackOption.FontBoxColor, "white")
                .set(MediaPackOption.FontBoxColorOpacity, "1");
        if (!blurPath.isEmpty()) {
            options.set(MediaPackOption.BlurPath, blurPath);
        }
        if (!stickerPath.isEmpty()) {
            options.set(MediaPackOption.StickerPath, stickerPath);
        }
        return MediaPack.combine(inputs, outputVideo, options, (duration, fileSize) -> {

        }, s -> {

        });
    }
}
